package com.lin.sms.dao.util;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.lin.sms.domain.Score;

public class ScoreRowMapper implements RowMapper<Score>{
	@Override
	public Score mapRow(ResultSet rs, int rowNum) throws SQLException {
		Score score = new Score();
		score.setId(rs.getInt("id"));
		score.setName(rs.getString("name"));
		score.setClassId(rs.getString("classId"));
		score.setChineseScore(rs.getInt("chineseScore"));
		score.setMathScore(rs.getInt("mathScore"));
		score.setEnglishScore(rs.getInt("englishScore"));
		return score;
	}
	 public static RowMapper<Score> getRowMapper(){
		 RowMapper<Score> rowMapper = new ScoreRowMapper();
		return rowMapper;
	 }
}
